from lib.ZSprite import ZSprite
from res.fun import _create_image , _random_pos
from res.glo import src
from res.conf import window_size , itemspeed , itemhealth

class Item(ZSprite):
    def __init__(self):
        super(Item , self).__init__()
        self.image = _create_image(src['image']['item']['heart'])
        self.rect = self.image.get_rect()
        self._pos = _random_pos(window_size[0] , -1600)
        self.speed = itemspeed
        self.health = itemhealth


    def update(self):
        if self.isRunning : self.rect.y += self.speed